package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.GreTreePatrolLogFileDao;
import cn.topevery.garden.entity.po.GreTreePatrolLogFile;
import cn.topevery.garden.entity.query.GreTreePatrolLogFileQuery;
import cn.topevery.garden.entity.vo.GreTreePatrolLogFileVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 
 *
 * @author code-generate
 * @date 2022-02-27
 */
@Service
public class GreTreePatrolLogFileLogic extends BaseLogic<GreTreePatrolLogFile> {
    @Autowired
    GreTreePatrolLogFileDao greTreePatrolLogFileDao;

    @Override
    public BaseEntityDao<GreTreePatrolLogFile, Integer> getDao() {
        return greTreePatrolLogFileDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<GreTreePatrolLogFileVO> listPage(GreTreePatrolLogFileQuery query) {
        return greTreePatrolLogFileDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        greTreePatrolLogFileDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param greTreePatrolLogFile 实体
     */
    public void saveOrUpdate(String userId, GreTreePatrolLogFile greTreePatrolLogFile){
        greTreePatrolLogFileDao.saveOrUpdate(userId,greTreePatrolLogFile);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public GreTreePatrolLogFile getEntityByColumn(String key, String value) {
        return greTreePatrolLogFileDao.getEntityByColumn(key, value);
    }

    public List<GreTreePatrolLogFile> getList(Integer id) {
        return greTreePatrolLogFileDao.getList(id);
    }

    public void deleteByPid(Integer id) {
        greTreePatrolLogFileDao.deleteByPid(id);
    }
}
